3.225 \(\int \frac {\tan (c+d x)}{\csc (c+d x)-\sin (c+d x)} \, dx\)

Optimal. Leaf size=34 \[ \frac {\tan (c+d x) \sec (c+d x)}{2 d}-\frac {\tanh ^{-1}(\sin (c+d x))}{2 d} \]

[Out]

-1/2*arctanh(sin(d*x+c))/d+1/2*sec(d*x+c)*tan(d*x+c)/d

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 34, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {288, 206} \[ \frac {\tan (c+d x) \sec (c+d x)}{2 d}-\frac {\tanh ^{-1}(\sin (c+d x))}{2 d} \]

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]/(Csc[c + d*x] - Sin[c + d*x]),x]

[Out]

-ArcTanh[Sin[c + d*x]]/(2*d) + (Sec[c + d*x]*Tan[c + d*x])/(2*d)

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 288

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c^(n - 1)*(c*x)^(m - n + 1)*(a + b*x^
n)^(p + 1))/(b*n*(p + 1)), x] - Dist[(c^n*(m - n + 1))/(b*n*(p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^(p + 1), x
], x] /; FreeQ[{a, b, c}, x] && IGtQ[n, 0] && LtQ[p, -1] && GtQ[m + 1, n] &&  !ILtQ[(m + n*(p + 1) + 1)/n, 0]
&& IntBinomialQ[a, b, c, n, m, p, x]

Rubi steps

\begin {align*} \int \frac {\tan (c+d x)}{\csc (c+d x)-\sin (c+d x)} \, dx &=\frac {\operatorname {Subst}\left (\int \frac {x^2}{\left (1-x^2\right )^2} \, dx,x,\sin (c+d x)\right )}{d}\\ &=\frac {\sec (c+d x) \tan (c+d x)}{2 d}-\frac {\operatorname {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sin (c+d x)\right )}{2 d}\\ &=-\frac {\tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {\sec (c+d x) \tan (c+d x)}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 34, normalized size = 1.00 \[ \frac {\tan (c+d x) \sec (c+d x)}{2 d}-\frac {\tanh ^{-1}(\sin (c+d x))}{2 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]/(Csc[c + d*x] - Sin[c + d*x]),x]

[Out]

-1/2*ArcTanh[Sin[c + d*x]]/d + (Sec[c + d*x]*Tan[c + d*x])/(2*d)

________________________________________________________________________________________

fricas [B]  time = 0.43, size = 61, normalized size = 1.79 \[ -\frac {\cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(csc(d*x+c)-sin(d*x+c)),x, algorithm="fricas")

[Out]

-1/4*(cos(d*x + c)^2*log(sin(d*x + c) + 1) - cos(d*x + c)^2*log(-sin(d*x + c) + 1) - 2*sin(d*x + c))/(d*cos(d*
x + c)^2)

________________________________________________________________________________________

giac [A]  time = 0.32, size = 48, normalized size = 1.41 \[ -\frac {\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} + \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right ) - \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right )}{4 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(csc(d*x+c)-sin(d*x+c)),x, algorithm="giac")

[Out]

-1/4*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) + log(abs(sin(d*x + c) + 1)) - log(abs(sin(d*x + c) - 1)))/d

________________________________________________________________________________________

maple [A]  time = 0.16, size = 60, normalized size = 1.76 \[ -\frac {1}{4 d \left (\sin \left (d x +c \right )-1\right )}+\frac {\ln \left (\sin \left (d x +c \right )-1\right )}{4 d}-\frac {1}{4 d \left (\sin \left (d x +c \right )+1\right )}-\frac {\ln \left (\sin \left (d x +c \right )+1\right )}{4 d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)/(csc(d*x+c)-sin(d*x+c)),x)

[Out]

-1/4/d/(sin(d*x+c)-1)+1/4/d*ln(sin(d*x+c)-1)-1/4/d/(sin(d*x+c)+1)-1/4/d*ln(sin(d*x+c)+1)

________________________________________________________________________________________

maxima [A]  time = 0.34, size = 46, normalized size = 1.35 \[ -\frac {\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} + \log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )}{4 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(csc(d*x+c)-sin(d*x+c)),x, algorithm="maxima")

[Out]

-1/4*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) + log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1))/d

________________________________________________________________________________________

mupad [B]  time = 1.00, size = 69, normalized size = 2.03 \[ \frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-\frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-tan(c + d*x)/(sin(c + d*x) - 1/sin(c + d*x)),x)

[Out]

(tan(c/2 + (d*x)/2) + tan(c/2 + (d*x)/2)^3)/(d*(tan(c/2 + (d*x)/2)^4 - 2*tan(c/2 + (d*x)/2)^2 + 1)) - atanh(ta
n(c/2 + (d*x)/2))/d

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\tan {\left (c + d x \right )}}{- \sin {\left (c + d x \right )} + \csc {\left (c + d x \right )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(csc(d*x+c)-sin(d*x+c)),x)

[Out]

Integral(tan(c + d*x)/(-sin(c + d*x) + csc(c + d*x)), x)

________________________________________________________________________________________